package com.example.softpart.magicAPiCustomFunction;

import cn.dev33.satoken.stp.StpUtil;
import com.example.softpart.unil.callMagicAPi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.ssssssss.magicapi.core.config.MagicFunction;
import org.ssssssss.magicapi.core.service.MagicAPIService;
import org.ssssssss.script.annotation.Comment;
import org.ssssssss.script.annotation.Function;



@Component  //注入到Spring容器中
public class roleFunction implements MagicFunction {

    @Function
    @Comment("判断是否拥有角色")
    public boolean hasRole(String role_ame) {
        // 获取：当前账号所拥有的权限集合
        return StpUtil.hasRole(role_ame);
    }
}
